


<template>
    <div class="model-form">
        <el-page-header @back="goBack" content="增加优惠券">
        </el-page-header>
        <div class="model-content">
            <el-form ref="ruleForm" :rules="rules" :model="form" label-width="160px">
                <el-row :gutter="10">
    <el-col :span="12">
            <el-form-item label="订单金额"  prop="orderAmount">
        <el-input v-model="form.orderAmount" name="orderAmount">
        </el-input>
            </el-form-item>

    </el-col>
    <el-col :span="12">
            <el-form-item label="优惠卷金额"  prop="discountAmount">
        <el-input v-model="form.discountAmount" name="discountAmount">
        </el-input>
            </el-form-item>

    </el-col>
    <el-col :span="12">
            <el-form-item label="名称"  prop="name">
        <el-input v-model="form.name" name="name">
        </el-input>
            </el-form-item>

    </el-col>
    <el-col :span="12">
            <el-form-item label="优惠券开始时间"  prop="useBeginTime">
        <el-date-picker v-model="form.useBeginTime" type="date" value-format="YYYY-MM-DD  HH:mm:ss" placeholder="选择日期">
        </el-date-picker>
            </el-form-item>

    </el-col>
    <el-col :span="12">
            <el-form-item label="优惠券截止时间"  prop="useEndTime">
        <el-date-picker v-model="form.useEndTime" type="date" value-format="YYYY-MM-DD  HH:mm:ss" placeholder="选择日期">
        </el-date-picker>
            </el-form-item>

    </el-col>

                    <el-col :span="22">
                        <el-form-item>
                            <el-button @click="goBack">取消</el-button>
                            <el-button type="primary" @click="createData">确定</el-button>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
        </div>
    </div>
</template>

<script setup>
        import nbSelect from "@/components/nbSelect.vue";
    import {ref} from "vue";
    import {useData} from "@/utils/useData";
    import {useCreate} from "@/uses/useCreate";

    const form = ref({
         orderAmount: null ,
         discountAmount: null ,
         name: null ,
         useBeginTime: null ,
         useEndTime: null     })

    const rules = ref({
    })

    const ruleForm = ref(null);

    const {createData,goBack} =useCreate("coupon",form,ruleForm)

</script>

<style scoped>
</style>